import { getBorrowDetail } from "@/api/borrow";
import BorrowForm from "@/components/BorrowForm";
import { useEffect, useState } from "react";
import { useRouter } from 'next/router';

export default function Home() {
    const [editData, set_editData] = useState({});
    const router = useRouter();
    const id: any = router.query.id;
    useEffect(() => {
        if (id) {
            getBorrowDetail(id).then(res => {
                set_editData(res.data);
            });
        }
    }, []);
    return <BorrowForm title={'借阅编辑'} editData={editData} />
}
